{% set title = 'Silenced errors' %}
{% extends "ereporter2/base.html" %}


{% block header %}
<style>
  h1 {
    margin-top: 10px;
    margin-bottom: 10px;
  }

  h3 {
    margin-bottom: 5px;
  }

  table.property_table {
    font-family: monospace;
    border-spacing: 0;
  }

  table.property_table tbody tr:nth-child(even) {
    background-color: #eeeeee;
  }

  table.property_table td {
    padding-left: 3em;
    padding-right: 3em;
  }

  table.property_table td:first-child {
    white-space: nowrap;
  }

  table.property_table tbody tr:hover {
    background-color: #eeffee;
  }
</style>
{% endblock %}


{% block body %}
<h1>Silenced errors</h1>
<a href="/restricted/ereporter2/report">Back to errors</a>
<p>
{% if silenced %}
  <table class=property_table>
    <thead>
      <th>Created</th>
      <th>Error signature</th>
      <th>Silenced</th>
      <th>Silenced until</th>
      <th>Threshold</th>
      <th>Action</th>
    </thead>
    <tbody>
      {% for item in silenced %}
      <tr>
        <td>{{item.created_ts|datetimeformat}}</td>
        <td>{{item.error}}</td>
        <td>{{item.silenced}}</td>
        <td>{{item.silenced_until|datetimeformat}}</td>
        <td>{{item.threshold}}</td>
        <td>
          <form method="POST">
            <input type=submit value="Delete"></input>
            <input type="hidden" name="to_delete" value="{{item.key.id()}}" />
            <input type="hidden" name="xsrf_token" value="{{xsrf_token}}" />
          </form>
        </td>
      </tr>
      {% endfor %}
    </tbody>
  </table>
{% else %}
  No error is silenced. Wait for useless errors to happen then silence them.
{% endif %}
{% endblock %}
